<template>
  <el-tabs v-model="activeTab" type="border-card" @tab-click="changeTab" class="tag-tabs">
    <el-tab-pane label="API列表" name="whole">
      <package-list ref="whole"></package-list>
    </el-tab-pane>
    <el-tab-pane label="我的API" name="personal">
      <package-personal-list ref="personal"></package-personal-list>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import packageList from './package-list'
import packagePersonalList from './package-personal-list'
export default {
  components: {
    packageList,
    packagePersonalList
  },
  data() {
    return {
      activeTab: 'whole'
    }
  },
  methods: {
    changeTab(tab) {
      if (this.$refs[tab.name].getList) this.$refs[tab.name].getList()
    }
  }
}
</script>

<style lang="scss"></style>
